<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>新员工试用期满（普通岗）-直接上级考核</title>
  <link rel="stylesheet" href="./asset/css/superior-assess-normal.css">
</head>

<body>
  <!-- <ul id="aside">
    <li class="selected"><a href="javascript:;" id="hrLink">直接上级考核</a></li>
    <li><a href="javascript:;" id="selfLink">员工个人总结</a></li>
    <li><a href="javascript:;" id="personalLink">绩效表现</a></li>
    <li><a href="javascript:;" id="peerLink">同级考核</a></li>
    <li><a href="javascript:;" id="hrLink">人力资源考核</a></li>
  </ul> -->
  <div class="main">
    <div class="clearfix logo">
      <div>
        <img src="./asset/images/logo.png" alt="中国·李山投资集团">
      </div>
    </div>
    <div class="button">
      <button id="submit">提交</button>
      <button id="download">导出</button>
    </div>
    <div id="pdf">
      <div class="title">新员工试用期满考评内容<span>LSHR-03-F</span></div>
      <div class="box">
        <div class="clearfix">
          <div class="td1">姓名</div>
          <div class="td1" id="username">自动获取</div>
          <div class="td1">岗位</div>
          <div class="td1 norb" id="station">自动获取</div>
        </div>
        <div class="clearfix">
          <div class="td1 h60">
            <div class="td1 td1-1 h60 fl nobb" id="caption"><span>项目</span><i></i><span>内容</span></div>
            <div class="td1 td1-2 h60 fl nobb norb lh60 fs16">要点</div>
          </div>
          <div class="td1 h60 lh60 fs16">优</div>
          <div class="td1 h60 lh60 fs16">良</div>
          <div class="td1 h60 lh60 norb fs16">合格</div>
        </div>
        <div class="clearfix">
          <div class="left">
            <div class="left-l">
              直接上级考核
            </div>
          </div>
          <div class="right clearfix">
            <!-- 专业知识能力 -->
            <div class="td1 h100 lh100 w131">专业知识能力10%</div>
            <div class="td1 h100">
              <div class="content">能够运用专业知识及时、有效的解决各类问题，圆满完成各项工作任务。</div>
              <div class="choose">
                <label for="zyzs10">
                  <input type="radio" class="radio" name="zyzs" id="zyzs10" value="10" />
                  <span>10</span>
                </label>
                <label for="zyzs9">
                  <input type="radio" class="radio" name="zyzs" id="zyzs9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">能够运用专业知识解决问题，完成工作任务。</div>
              <div class="choose">
                <label for="zyzs8">
                  <input type="radio" class="radio" name="zyzs" id="zyzs8" value="8" />
                  <span>8</span>
                </label>
                <label for="zyzs7">
                  <input type="radio" class="radio" name="zyzs" id="zyzs7" value="7" />
                  <span>7</span>
                </label>
                <label for="zyzs6">
                  <input type="radio" class="radio" name="zyzs" id="zyzs6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">专业知识明显不足，影响工作进展。</div>
              <div class="choose">
                <label for="zyzs5">
                  <input type="radio" class="radio" name="zyzs" id="zyzs5" value="5" />
                  <span>5</span>
                </label>
                <label for="zyzs4">
                  <input type="radio" class="radio" name="zyzs" id="zyzs4" value="4" />
                  <span>4</span>
                </label>
                <label for="zyzs3">
                  <input type="radio" class="radio" name="zyzs" id="zyzs3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 工作效率 -->
            <div class="td1 h100 lh100 w131">工作效率10%</div>
            <div class="td1 h100">
              <div class="content">效率甚高, 工作量超过标准, 且能提前完成。</div>
              <div class="choose">
                <label for="gzxl10">
                  <input type="radio" class="radio" name="gzxl" id="gzxl10" value="10" />
                  <span>10</span>
                </label>
                <label for="gzxl9">
                  <input type="radio" class="radio" name="gzxl" id="gzxl9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">效率好, 工作量达到标准, 偶尔需要帮助，能按时完成。</div>
              <div class="choose">
                <label for="gzxl8">
                  <input type="radio" class="radio" name="gzxl" id="gzxl8" value="8" />
                  <span>8</span>
                </label>
                <label for="gzxl7">
                  <input type="radio" class="radio" name="gzxl" id="gzxl7" value="7" />
                  <span>7</span>
                </label>
                <label for="gzxl6">
                  <input type="radio" class="radio" name="gzxl" id="gzxl6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">效率不高, 工作量未达到标准, 经常需要别人帮助。</div>
              <div class="choose">
                <label for="gzxl5">
                  <input type="radio" class="radio" name="gzxl" id="gzxl5" value="5" />
                  <span>5</span>
                </label>
                <label for="gzxl4">
                  <input type="radio" class="radio" name="gzxl" id="gzxl4" value="4" />
                  <span>4</span>
                </label>
                <label for="gzxl3">
                  <input type="radio" class="radio" name="gzxl" id="gzxl3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 工作品质 -->
            <div class="td1 h100 lh100 w131">工作品质10%</div>
            <div class="td1 h100">
              <div class="content">工作的处理过程与结果 均是正确且足以被信赖。</div>
              <div class="choose">
                <label for="gzpz10">
                  <input type="radio" class="radio" name="gzpz" id="gzpz10" value="10" />
                  <span>10</span>
                </label>
                <label for="gzpz9">
                  <input type="radio" class="radio" name="gzpz" id="gzpz9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">偶尔发生错误, 但尚能细心更正, 成果是正确且尚足以被信赖。</div>
              <div class="choose">
                <label for="gzpz8">
                  <input type="radio" class="radio" name="gzpz" id="gzpz8" value="8" />
                  <span>8</span>
                </label>
                <label for="gzpz7">
                  <input type="radio" class="radio" name="gzpz" id="gzpz7" value="7" />
                  <span>7</span>
                </label>
                <label for="gzpz6">
                  <input type="radio" class="radio" name="gzpz" id="gzpz6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">粗心大意, 时常发生错误。</div>
              <div class="choose">
                <label for="gzpz5">
                  <input type="radio" class="radio" name="gzpz" id="gzpz5" value="5" />
                  <span>5</span>
                </label>
                <label for="gzpz4">
                  <input type="radio" class="radio" name="gzpz" id="gzpz4" value="4" />
                  <span>4</span>
                </label>
                <label for="gzpz3">
                  <input type="radio" class="radio" name="gzpz" id="gzpz3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 工作进取心 -->
            <div class="td1 h100 lh100 w131">工作进取心10%</div>
            <div class="td1 h100">
              <div class="content">工作进取心很强，虚心学习，很快能上手。</div>
              <div class="choose">
                <label for="gzjqx10">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx10" value="10" />
                  <span>10</span>
                </label>
                <label for="gzjqx9">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">工作进取心较强，有问题能请教，基本能上手。</div>
              <div class="choose">
                <label for="gzjqx8">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx8" value="8" />
                  <span>8</span>
                </label>
                <label for="gzjqx7">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx7" value="7" />
                  <span>7</span>
                </label>
                <label for="gzjqx6">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">工作进取心一般，虚心学习不够，很少向人请教，手较慢。</div>
              <div class="choose">
                <label for="gzjqx5">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx5" value="5" />
                  <span>5</span>
                </label>
                <label for="gzjqx4">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx4" value="4" />
                  <span>4</span>
                </label>
                <label for="gzjqx3">
                  <input type="radio" class="radio" name="gzjqx" id="gzjqx3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 适应能力 -->
            <div class="td1 h100 lh100 w131">适应能力10%</div>
            <div class="td1 h100">
              <div class="content">适应能力很强，弹性大，轻松掌握新工作。</div>
              <div class="choose">
                <label for="synl10">
                  <input type="radio" class="radio" name="synl" id="synl10" value="10" />
                  <span>10</span>
                </label>
                <label for="synl9">
                  <input type="radio" class="radio" name="synl" id="synl9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">吸收快，学习新工作轻松，基本能适应公司节奏。</div>
              <div class="choose">
                <label for="synl8">
                  <input type="radio" class="radio" name="synl" id="synl8" value="8" />
                  <span>8</span>
                </label>
                <label for="synl7">
                  <input type="radio" class="radio" name="synl" id="synl7" value="7" />
                  <span>7</span>
                </label>
                <label for="synl6">
                  <input type="radio" class="radio" name="synl" id="synl6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">适应能力一般，尚需进一步了解学习。</div>
              <div class="choose">
                <label for="synl5">
                  <input type="radio" class="radio" name="synl" id="synl5" value="5" />
                  <span>5</span>
                </label>
                <label for="synl4">
                  <input type="radio" class="radio" name="synl" id="synl4" value="4" />
                  <span>4</span>
                </label>
                <label for="synl3">
                  <input type="radio" class="radio" name="synl" id="synl3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 责任心 -->
            <div class="td1 h100 lh100 w131">责任心10%</div>
            <div class="td1 h100">
              <div class="content">可以放心交付工作，能够彻底完成目标和任务，工作认真负责，问题意识较强。</div>
              <div class="choose">
                <label for="zrx10">
                  <input type="radio" class="radio" name="zrx" id="zrx10" value="10" />
                  <span>10</span>
                </label>
                <label for="zrx9">
                  <input type="radio" class="radio" name="zrx" id="zrx9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">具有责任心，可以交付工作，但须督导方可完成。</div>
              <div class="choose">
                <label for="zrx8">
                  <input type="radio" class="radio" name="zrx" id="zrx8" value="8" />
                  <span>8</span>
                </label>
                <label for="zrx7">
                  <input type="radio" class="radio" name="zrx" id="zrx7" value="7" />
                  <span>7</span>
                </label>
                <label for="zrx6">
                  <input type="radio" class="radio" name="zrx" id="zrx6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">责任心不强，须常督促，尚不能完成任务。</div>
              <div class="choose">
                <label for="zrx5">
                  <input type="radio" class="radio" name="zrx" id="zrx5" value="5" />
                  <span>5</span>
                </label>
                <label for="zrx4">
                  <input type="radio" class="radio" name="zrx" id="zrx4" value="4" />
                  <span>4</span>
                </label>
                <label for="zrx3">
                  <input type="radio" class="radio" name="zrx" id="zrx3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 解决问题能力 -->
            <div class="td1 h100 lh100 w131">解决问题能力10%</div>
            <div class="td1 h100">
              <div class="content">对指派的工作有极佳的知识，很少需要指导分。</div>
              <div class="choose">
                <label for="jjwtnl10">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl10" value="10" />
                  <span>10</span>
                </label>
                <label for="jjwtnl9">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">有相当好的知识运用能力，熟悉业务深入，偶尔需要指导。</div>
              <div class="choose">
                <label for="jjwtnl8">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl8" value="8" />
                  <span>8</span>
                </label>
                <label for="jjwtnl7">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl7" value="7" />
                  <span>7</span>
                </label>
                <label for="jjwtnl6">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">知识运用能力不足，对岗位所需要求了解不足。</div>
              <div class="choose">
                <label for="jjwtnl5">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl5" value="5" />
                  <span>5</span>
                </label>
                <label for="jjwtnl4">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl4" value="4" />
                  <span>4</span>
                </label>
                <label for="jjwtnl3">
                  <input type="radio" class="radio" name="jjwtnl" id="jjwtnl3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 服务精神 -->
            <div class="td1 h100 lh100 w131">服务精神10%</div>
            <div class="td1 h100">
              <div class="content">对工作有责任心与热情，乐意协助他人。</div>
              <div class="choose">
                <label for="fwjs10">
                  <input type="radio" class="radio" name="fwjs" id="fwjs10" value="10" />
                  <span>10</span>
                </label>
                <label for="fwjs9">
                  <input type="radio" class="radio" name="fwjs" id="fwjs9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">乐意担任工作并能做好分派工作，很少对分派的工作不满。</div>
              <div class="choose">
                <label for="fwjs8">
                  <input type="radio" class="radio" name="fwjs" id="fwjs8" value="8" />
                  <span>8</span>
                </label>
                <label for="fwjs7">
                  <input type="radio" class="radio" name="fwjs" id="fwjs7" value="7" />
                  <span>7</span>
                </label>
                <label for="fwjs6">
                  <input type="radio" class="radio" name="fwjs" id="fwjs6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">有时不愿接受自己被分派的工作，对主管善意的建议不予理会。</div>
              <div class="choose">
                <label for="fwjs5">
                  <input type="radio" class="radio" name="fwjs" id="fwjs5" value="5" />
                  <span>5</span>
                </label>
                <label for="fwjs4">
                  <input type="radio" class="radio" name="fwjs" id="fwjs4" value="4" />
                  <span>4</span>
                </label>
                <label for="fwjs3">
                  <input type="radio" class="radio" name="fwjs" id="fwjs3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
            <!-- 团队协作 -->
            <div class="td1 h100 lh100 w131">团队协作20%</div>
            <div class="td1 h100">
              <div class="content">能与同事很好的协调相处，乐于助人，大家对其评价高。</div>
              <div class="choose">
                <label for="tdxz10">
                  <input type="radio" class="radio" name="tdxz" id="tdxz10" value="10" />
                  <span>10</span>
                </label>
                <label for="tdxz9">
                  <input type="radio" class="radio" name="tdxz" id="tdxz9" value="9" />
                  <span>9</span>
                </label>
              </div>
            </div>
            <div class="td1 h100">
              <div class="content">与别人相处融洽, 待人亲切有礼, 合作度高。</div>
              <div class="choose">
                <label for="tdxz8">
                  <input type="radio" class="radio" name="tdxz" id="tdxz8" value="8" />
                  <span>8</span>
                </label>
                <label for="tdxz7">
                  <input type="radio" class="radio" name="tdxz" id="tdxz7" value="7" />
                  <span>7</span>
                </label>
                <label for="tdxz6">
                  <input type="radio" class="radio" name="tdxz" id="tdxz6" value="6" />
                  <span>6</span>
                </label>
              </div>
            </div>
            <div class="td1 h100 norb">
              <div class="content">与同事相处一般, 草率依赖, 与大家沟通较少，缺乏团队精神。</div>
              <div class="choose">
                <label for="tdxz5">
                  <input type="radio" class="radio" name="tdxz" id="tdxz5" value="5" />
                  <span>5</span>
                </label>
                <label for="tdxz4">
                  <input type="radio" class="radio" name="tdxz" id="tdxz4" value="4" />
                  <span>4</span>
                </label>
                <label for="tdxz3">
                  <input type="radio" class="radio" name="tdxz" id="tdxz3" value="3" />
                  <span>3</span>
                </label>
              </div>
            </div>
          </div>
        </div>
        <div class="total">综合得分：<span id="totalscore">自动计算</span>分</div>
        <div class="sign">签名：
          <input type="text" class="signinput">
        </div>
        <div class="date">
          <input type="text" class="yearinput dateinput">年
          <input type="text" class="monthinput dateinput">月
          <input type="text" class="dayinput dateinput">日
        </div>
      </div>
    </div>
  </div>
  <script src="./js/jquery-1.8.3.min.js"></script>
  <script>
    var type = /type=(\w+)/gi.exec(window.location.href);
    var empid = /empid=(\w+)/gi.exec(window.location.href);
    // var baseUrl = 'http://192.168.22.45:5526/';
    // var baseUrl = 'http://192.168.3.26:5526/';
    var baseUrl = 'http://report.wsloan.com:5526/EmployeeSystem';

    // 获取人员数据
    if (empid) {
      empid = empid[1];
    } else {
      // 没有empid的处理
    }

    // 判断是编辑还是预览
    if (type) {
      type = type[1];
      if (type == 'edit') {
        // 编辑
        $('#submit').show();
        var username = /username=([\u4E00-\u9FA5]+)/gi.exec(decodeURIComponent(window.location.href));
        var station = /station=([\u4E00-\u9FA5a-zA-Z]+)/gi.exec(decodeURIComponent(window.location.href));
        if (username) {
          username = username[1];
        } else {
          // 没有username的处理
        }
        if (station) {
          station = station[1];
        } else {
          // 没有station的处理
        }
        $('#username').text(username);
        $('#station').text(station);
      } else if (type == 'preview') {
        if (empid) {
          // 预览 获取数据
          $.ajax({
            url: baseUrl + 'show/leaderscore.htmls',
            type: 'post',
            dataType: 'json',
            data: {
              empid: empid
            },
            success: function(data) {
              // console.log(data);
              if (data.code == 0) {
                $('#username').text(data.data.username);
                $('#station').text(data.data.station);
                $('.radio[name="zyzs"][value=' + data.data.leader1 + ']').attr('checked', 'checked');
                $('.radio[name="gzxl"][value=' + data.data.leader2 + ']').attr('checked', 'checked');
                $('.radio[name="gzpz"][value=' + data.data.leader3 + ']').attr('checked', 'checked');
                $('.radio[name="gzjqx"][value=' + data.data.leader4 + ']').attr('checked', 'checked');
                $('.radio[name="synl"][value=' + data.data.leader5 + ']').attr('checked', 'checked');
                $('.radio[name="zrx"][value=' + data.data.leader6 + ']').attr('checked', 'checked');
                $('.radio[name="jjwtnl"][value=' + data.data.leader7 + ']').attr('checked', 'checked');
                $('.radio[name="fwjs"][value=' + data.data.leader8 + ']').attr('checked', 'checked');
                $('.radio[name="tdxz"][value=' + data.data.leader9/2 + ']').attr('checked', 'checked');
                $('#totalscore').text(data.data.leader1 + data.data.leader2 + data.data.leader3 + data.data.leader4 + data.data.leader5 + data.data.leader6 + data.data.leader7 + data.data.leader8 + data.data.leader9);
              }
            },
            error: function(error) {
              console.log(error);
            }
          });
        }
        $('.radio,.dateinput,.signinput').attr('disabled', 'true');
        $('#download').show();
      } else {
        // 非法参数值处理
      }
    } else {
      // 没有type值的处理
    }

    // 计算分数
    $('.radio').on('change', function() {
      var val1 = $(".radio[name='zyzs']:checked").val();
      val1 = val1 ? Number(val1) : 0;
      var val2 = $(".radio[name='gzxl']:checked").val();
      val2 = val2 ? Number(val2) : 0;
      var val3 = $(".radio[name='gzpz']:checked").val();
      val3 = val3 ? Number(val3) : 0;
      var val4 = $(".radio[name='gzjqx']:checked").val();
      val4 = val4 ? Number(val4) : 0;
      var val5 = $(".radio[name='synl']:checked").val();
      val5 = val5 ? Number(val5) : 0;
      var val6 = $(".radio[name='zrx']:checked").val();
      val6 = val6 ? Number(val6) : 0;
      var val7 = $(".radio[name='jjwtnl']:checked").val();
      val7 = val7 ? Number(val7) : 0;
      var val8 = $(".radio[name='fwjs']:checked").val();
      val8 = val8 ? Number(val8) : 0;
      var val9 = $(".radio[name='tdxz']:checked").val();
      val9 = val9 ? Number(val9) * 2 : 0;
      var val = val1 + val2 + val3 + val4 + val5 + val6 + val7 + val8 + val9;
      $('#totalscore').text(val);
      console.log(val);
    });

    // 提交
    $('#submit').on('click', function(e) {
      e.stopPropagation();
      e.preventDefault();
      var leader1 = $(".radio[name='zyzs']:checked").val();
      var leader2 = $(".radio[name='gzxl']:checked").val();
      var leader3 = $(".radio[name='gzpz']:checked").val();
      var leader4 = $(".radio[name='gzjqx']:checked").val();
      var leader5 = $(".radio[name='synl']:checked").val();
      var leader6 = $(".radio[name='zrx']:checked").val();
      var leader7 = $(".radio[name='jjwtnl']:checked").val();
      var leader8 = $(".radio[name='fwjs']:checked").val();
      var leader9 = $(".radio[name='tdxz']:checked").val();
      if (!leader1 || !leader2 || !leader3 || !leader4 || !leader5 || !leader6 || !leader7 || !leader8 || !leader9) {
        alert('还有未打分的项目');
        return false;
      }
      console.log({
        empid: empid,
        leader1: leader1,
        leader2: leader2,
        leader3: leader3,
        leader4: leader4,
        leader5: leader5,
        leader6: leader6,
        leader7: leader7,
        leader8: leader8,
        leader9: leader9 * 2
      });
      $.ajax({
        url: baseUrl + "insert/leaderpscore.htmls",
        type: 'post',
        dataType: 'json',
        data: {
          empid: empid,
          leader1: leader1,
          leader2: leader2,
          leader3: leader3,
          leader4: leader4,
          leader5: leader5,
          leader6: leader6,
          leader7: leader7,
          leader8: leader8,
          leader9: leader9 * 2
        },
        success: function(data) {
          var url = window.location.href
          if (data.code === 0) {
            alert(data.msg);
            url = url.replace(/type=edit/, 'type=preview');
            window.location.replace(url)
          }
        },
        error: function(error) {
          console.log(error);
        }
      });
    });
  </script>
  <script src="./js/jspdf.debug.js"></script>
  <!-- <script src="./js/jspdf.min.js"></script> -->
  <script src="./js/download.js"></script>
</body>

</html>
